
#include "Spoke.h"

long Spoke::totalObjectCount = 0;
long Spoke::ObjectCount = 0;

Spoke::Spoke(double x, double y, int i, double OUTdiameter, double INdiameter)
		:ID(++totalObjectCount), 
		m_cPoint(gPoint(x,y), 0, 360*i/20), m_Points()   { 
/*
	cout << "Spoke( x = " << x << " y = " << y << " i = " << i 
			<< " OUTdiameter = " << OUTdiameter 
			<< " INdiameter = " << INdiameter << ")\n";
*/	
	++ObjectCount;
	
	m_Points.addPoint(lPoint(m_cPoint.getPol(), INdiameter/2, 360*i/20));
	m_Points.addPoint(lPoint(m_cPoint.getPol(), OUTdiameter/2, 360*i/20));
	
//	cout << "Spoke ID = " << ID << "\n";
//	getch();
 }
Spoke::Spoke(const Spoke& S)
		:ID(++totalObjectCount), m_Points(S.getSPoints() ), m_cPoint(S.getcPoint()) {
//	cout << "Spoke( const Spoke& (ID) = " << S.getID() << " ) \n";
	
	++ObjectCount;
	
//	cout << "Spoke ID = " << ID << "\n";
//	getch();
}
Spoke::~Spoke() {
//	cout << "~Spoke ID = " << ID << "\n";
	--ObjectCount;
//	getch();
}
	
void Spoke::turnOnDfi(double m_fi) {
//	cout << "Spoke turnOnDfi{\n";
//	cout << "Spoke m_cPoint turnOnDfi\n";
	m_cPoint.turnOnDfi(m_fi);
//	cout << "Spoke m_Points turnOnDfi\n";
	m_Points.turnPoinsOnDfi(m_fi);
//	cout << "}Spoke turnOnDfi\n";
}
void Spoke::moveToXY(double x, double y) {
	m_cPoint.moveToXY(x, y);
	m_Points.movePoinsToXY(x, y);
}
void Spoke::moveOnDx(double dx) {
	m_cPoint.moveOnDx(dx);
	m_Points.movePoinsOnDx(dx);
}
void Spoke::moveOnDy(double dy) {
	m_cPoint.moveOnDy(dy);
	m_Points.movePoinsOnDy(dy);
}

void Spoke::printInfo() const {
	cout << " Spoke:\n";
	m_cPoint.printInfo();
	m_Points.printInfo();
}